#!/bin/sh

#
# Please make sure that the following things are OK:
#
#   1. You have installed the arm-elf-tools already.
#   2. Your uClinux distribution has been installed into the directory of '/opt/uClinux-dist/'.
#      If not, please modify the definition of UCLINUX_DIR.
#

rm config.cache config.status -f

UCLINUX_DIR=/opt/uClinux/uClinux-dist

CC=arm-elf-gcc \
CFLAGS="-O2 -g -fno-builtin -mapcs-32 -march=armv4 -mtune=arm7tdmi -mshort-load-bytes -msoft-float -I${UCLINUX_DIR}/uClibc/include -I${UCLINUX_DIR}/linux-2.4.x/include -I${UCLINUX_DIR}/arm-elf/include -nostartfiles " \
LDFLAGS="-Wl,-elf2flt ${UCLINUX_DIR}/uClibc/lib/crt0.o ${UCLINUX_DIR}/uClibc/lib/crti.o ${UCLINUX_DIR}/uClibc/lib/crtn.o -L${UCLINUX_DIR}/uClibc/lib -L/${UCLINUX_DIR}/uClibc/libm -L${UCLINUX_DIR}/arm-elf/lib -lc" \
./configure \
    --build=i386-linux \
    --host=arm-elf-linux \
    --target=arm-elf-linux 

